package edu.hku.c3330.hkucompanion.manager;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Assessment extends Event {

	public enum AssessmentType
	{
		LECTURE, TUTORIAL, DISCUSSION, FIELD_TRIP, PROJECT, PRESENTATION, ASSIGNMENT, QUIZ, MIDTERM, EXAMINATION, OTHERS
	}
	
	AssessmentType type;
	Map<String,Long> references;
	long	courseId = -1,
			eventId = -1,
			assessmentId = -1;
	
	public Assessment(){
		super();
	}
	
	public Assessment(String title, String description, String location, short priority, AssessmentType type) 
	{
		super(title, description, location, priority);
		this.type = type;
		this.isCustomEvent = false;
		this.references = new HashMap<String,Long>();
	}
	
	public Assessment(Event baseEvent, AssessmentType type, Map<String, Long> references)
	{
		cloneFrom(baseEvent);
		this.type = type;
		setReferences(references);
	}
	
	public AssessmentType getType() {
		return type;
	}

	public void setType(AssessmentType type) {
		this.type = type;
	}

	public List<String> getReferences() {
		return new ArrayList<String>(references.keySet());
	}

	public void setDatabaseId(long courseId, long eventId, long assessmentId)
	{
		this.courseId = courseId;
		this.eventId = eventId;
		this.assessmentId = assessmentId;
	}
	
	public void putReference(String ref)
	{
		putReference(ref, -1);
	}
	
	public void putReference(String ref, long id)
	{
		references.put(ref, id);
	}
	
	public void setReferences(Map<String,Long> references)
	{
		this.references = references;
	}
	
	public long getCourseID()
	{
		return courseId;
	}
	
	
}
